package com.xique.system.service.service.impl;

import cn.hutool.core.convert.Convert;
import com.xique.common.core.utils.DateUtils;
import com.xique.system.bean.domain.ParkPayIcbc;
import com.xique.system.mapper.ParkPayIcbcMapper;
import com.xique.system.service.service.ParkPayIcbcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 工行支付配置Service业务层处理
 * 
 * @author caogq
 * @date 2022-07-15
 */
@Service
public class ParkPayIcbcServiceImpl implements ParkPayIcbcService
{
    @Autowired
    private ParkPayIcbcMapper parkPayIcbcMapper;

    /**
     * 查询工行支付配置
     * 
     * @param id 工行支付配置ID
     * @return 工行支付配置
     */
    @Override
    public ParkPayIcbc selectParkPayIcbcById(Long id)
    {
        return parkPayIcbcMapper.selectParkPayIcbcById(id);
    }

    /**
     * 查询工行支付配置列表
     * 
     * @param parkPayIcbc 工行支付配置
     * @return 工行支付配置
     */
    @Override
    public List<ParkPayIcbc> selectParkPayIcbcList(ParkPayIcbc parkPayIcbc)
    {
        return parkPayIcbcMapper.selectParkPayIcbcList(parkPayIcbc);
    }

    /**
     * 新增工行支付配置
     * 
     * @param parkPayIcbc 工行支付配置
     * @return 结果
     */
    @Override
    public int insertParkPayIcbc(ParkPayIcbc parkPayIcbc)
    {
        parkPayIcbc.setCreateTime(DateUtils.getNowDate());
        return parkPayIcbcMapper.insertParkPayIcbc(parkPayIcbc);
    }

    /**
     * 修改工行支付配置
     * 
     * @param parkPayIcbc 工行支付配置
     * @return 结果
     */
    @Override
    public int updateParkPayIcbc(ParkPayIcbc parkPayIcbc)
    {
        parkPayIcbc.setUpdateTime(DateUtils.getNowDate());
        return parkPayIcbcMapper.updateParkPayIcbc(parkPayIcbc);
    }

    /**
     * 删除工行支付配置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteParkPayIcbcByIds(String ids)
    {
        return parkPayIcbcMapper.deleteParkPayIcbcByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除工行支付配置信息
     * 
     * @param id 工行支付配置ID
     * @return 结果
     */
    public int deleteParkPayIcbcById(Long id)
    {
        return parkPayIcbcMapper.deleteParkPayIcbcById(id);
    }
}
